
from django import forms

from sforms import models

class NameForm(forms.Form):
    your_name = forms.CharField(label='my name', max_length=5)


class ContactForm(forms.Form):

    prefix = 'contact'

    error_css_class = 'error'
    required_css_class = 'required'

    subject = forms.CharField(max_length=100, help_text='subject of email',
                              error_messages=dict(required='Please enter your name'))
    message = forms.CharField(widget=forms.Textarea(attrs=dict(id='my_test')))
    sender = forms.EmailField(show_hidden_initial='spybdai@gmail.com', widget=forms.HiddenInput())
    cc_myself = forms.BooleanField(required=False, label='you r stupid')


class UploadFileForm(forms.Form):

    title = forms.CharField(max_length=50)
    content = forms.FileField()


class UploadModelFileForm(forms.ModelForm):

    class Meta:
        model = models.UploadFile
        fields = ['title', 'content']

